package test02;

public class JoinTest extends Thread {
	@Override
	public void run() {
		for (int i = 0; i < 20; i++) {
			System.out.println(Thread.currentThread().getName()+":"+i);
		}
	}
	public static void main(String[] args) {
		Thread thread=new JoinTest();
		thread.start();
		for (int i = 0; i < 10; i++) {
			try {
			if (i==7) {
				thread.join();
			}
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
			System.out.println(Thread.currentThread().getName()+":"+i);
	}
	}
}
